//
//  PK-ios
//
//  Created by Seven on 15/9/15.
//  Copyright (c) 2015年 Seven. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "UIImage+ResizeImage.h"
#import "UIImage+Tint.h"
#import "UIImage+QRCode.h"
#import "UIImage+GSGif.h"

@interface UIImage (Category)


- (UIImage *)imageByApplyingAlpha:(CGFloat)alpha;

//将图片剪裁至目标尺寸
+ (UIImage *) imageByScalingAndCroppingForSourceImage:(UIImage *)sourceImage targetSize:(CGSize)targetSize;

+ (UIImage *) imageByScalingToMaxSize:(UIImage *)sourceImage;
//图片旋转角度
- (UIImage *) imageRotatedByDegrees:(CGFloat)degrees;

//拉伸图片UIEdgeInsets
- (UIImage *) resizableImage:(UIEdgeInsets)insets;

//拉伸图片CGFloat
- (UIImage *) imageByResizeToScale:(CGFloat)scale;

//放大图片CGSize
- (UIImage *) imageByResizeWithMaxSize:(CGSize)size;

//小样图图片CGSize
- (UIImage *) imageWithThumbnailForSize:(CGSize)size;

//压缩图片到指定大小kb
+(UIImage *)scaleImage:(UIImage *)image toKb:(NSInteger)kb;


// view 转成图片
+(UIImage*)imageFromView:(UIView*)view;



@end

@interface UIImage (Blur)
//玻璃化效果，这里与系统的玻璃化枚举效果一样，但只是一张图
//- (UIImage *)imageByBlurSoft;
//
//- (UIImage *)imageByBlurLight;
//
//- (UIImage *)imageByBlurExtraLight;
//
//- (UIImage *)imageByBlurDark;
//
//- (UIImage *)imageByBlurWithTint:(UIColor *)tintColor;
//
//- (UIImage *)imageByBlurRadius:(CGFloat)blurRadius
//                     tintColor:(UIColor *)tintColor
//                      tintMode:(CGBlendMode)tintBlendMode
//                    saturation:(CGFloat)saturation
//                     maskImage:(UIImage *)maskImage;

- (UIImage *) boxblurImageWithBlur:(CGFloat)blur exclusionPath:(UIBezierPath *)exclusionPath;
@end





@interface UIImage (ImageEffects)

//图片效果

- (UIImage *)applyLightEffect;
- (UIImage *)applyExtraLightEffect;
- (UIImage *)applyDarkEffect;
- (UIImage *)applyBlurEffect;
- (UIImage *)applyTintEffectWithColor:(UIColor *)tintColor;
- (UIImage *)applyBlurWithRadius:(CGFloat)blurRadius
                       tintColor:(UIColor *)tintColor
           saturationDeltaFactor:(CGFloat)saturationDeltaFactor
                       maskImage:(UIImage *)maskImage;
@end

@interface UIImage (GIFProperty)
@property(nonatomic,strong) NSNumber *isGIF;
@property(nonatomic,strong) NSData   *imgData;
@end


@interface UIImage(icon)

+ (UIImage *)backIcon;

+ (UIImage *)iconWithName:(NSString *)name color:(UIColor *)color size:(CGFloat)size;

+ (UIImage *)templateIconWithName:(NSString *)name;
@end


@interface UIImage(color)

+(UIImage *)getGradientImageWithColors:(NSArray*)colors imgSize:(CGSize)imgSize;

+(UIImage *)getGradientImageWithColors:(NSArray*)colors imgSize:(CGSize)imgSize start:(CGPoint)start endPoint:(CGPoint)end;

@end
